<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>供应商平台</title>
</head>
<body class="tob-wrap">
	<div th:replace="common/top"></div>
	
	<article class="container container-a1-register clearfix">
		<section class="content">
			<div class="form-register">
				<nav>
					<a id="personal" class="active" href="#"><span th:text="#{register.personal.account}"></span></a><a
						id="enterprise" href="#"><span th:text="#{register.company.account}"></span></a>
				</nav>
				<div class="forms">
					<form id="form_personal" action="#" method="post" th:action="@{/register/createUser}" th:object="${user}">
						
						<div style="color: red; text-align: center;">  
						            <span th:text="${errorMsg}"></span>
						</div>			    
						<p>
							<label for=""><strong>*</strong>用户昵称 : </label> <span
								class="m-error-text m-error-text-input"> <input
								class="input" type="text" placeholder="请输入手机/邮箱" id="username" th:field="*{username}"  name="username" /> 
								<em class="m-error-text-inner">报错文案(通用部分,
									见T_common_component.html)</em>
							</span>
						</p>
						<p>
							<label for=""><strong>*</strong>用户角色 : </label> <select
								class="select"  id="" name="role">
								<option value="1">管理员</option>
								<option value="2">销售员</option>
							</select>
						</p>
						<p>
							<label for="">
							<strong>*</strong>所属企业 : </label>
							<select  class="select" name ="companyId" id="companyId">
				              <option th:each="company : ${companyList}" th:value="${company.id}" th:text="${company.companyName}"></option>
				            </select>
							 <span class="span-prompt">温馨提示：如未找到，请点击 <a href="#" id="create_enterprise">“新建企业账户”</a></span>
						</p>
						<p>
							<label for=""><strong>*</strong>手机号码 : </label> <input
								class="m-error-text input" type="text" placeholder="请输入手机号码" th:field="*{mobilePhone}" id="mobile" name="mobile"/>
							<button class="btn btn-cyan-simple btn-border ml-10"
								type="button" id="getcode">获取验证码</button>
						</p>
						<p>
							<label for=""><strong>*</strong>短信验证码 : </label> <input
								class="input" type="text" placeholder="请输入短信验证码" id="mobilecode" name="mobilecode"/>
						</p>
						<p>
							<label for=""><strong>*</strong>设置密码 : </label> <input
								class="input" type="password" name="password" id="password" th:field="*{password}" placeholder="请输入密码"/><!-- <i
								class="icon icon-ok"></i> <i class="icon icon-no"></i> --> <span
								class="span-prompt">温馨提示：密码需包含字母、数字和字符三者中<br />的两种或以上，最短8位数
							</span>
						</p>
						<p>
							<label for=""><strong>*</strong>再次确认密码 : </label> <input
								class="input" type="password" name="password2" id="password2" placeholder="请再次输入密码"/>
						</p>
						<p>
							<label for=""><strong>*</strong>负责的客户 : </label> 
							<select  class="select" name ="clientId">
				              <option th:each="company : ${clientList}" th:value="${company.id}" th:text="${company.companyName}"></option>
				            </select>
						</p>
						<p>
							<label for=""><strong>*</strong>公司验证码 : </label> <input
								class="input" type="text" placeholder="请输入" id="companycode" name="companycode"/><button class="btn btn-cyan-simple btn-border ml-10"
								type="button" id="getcode">获取验证码</button> <span
								class="span-prompt">温馨提示：请联系贵公司的XXX，电话：010-<br />12345678取得发送到他手机上的公司验证码，<br />或等待他上线批准您的新用户申请
							</span>
						</p>
						<p>
<!-- 							<label for="">所属语言 : </label> <select class="select" name="" -->
<!-- 								id=""> -->
<!-- 								<option value="">中文(简体)</option> -->
<!-- 								<option value="">English</option> -->
<!-- 							</select> -->
						</p>
						<p>
							<label for=""></label> <span> <input type="checkbox"
								checked="checked"/> <em>请输入手机号码</em> <a href="#">《个人账户注册协议》</a>
							</span>
						</p>
						<p class="btn-bar">
							<label for=""></label> <span>
								<button class="btn btn-cyan" type="submit">提交</button>
								<button class="btn" type="reset">取消</button>
							</span>
						</p>
					</form>

					<form style="display: none" id="form_enterprise" name="form_enterprise" action="#"
						th:action="@{/register/createCompany}" th:object="${company}" method="post">
						<span th:text="${errorMsg}"></span>
						<p>
							<label for=""><strong>*</strong>企业名称 : </label> <input
								class="input" type="text" placeholder="请输入企业名称" th:field="*{companyName}" id="companyname" name="companyname"/>
						</p>
						<p>
							<label for=""><strong>*</strong>营业执照号码 : </label> <input
								class="input" type="text" placeholder="请输入营业执照号码" th:field="*{businessId}" id="businessid" name="businessid"/>
						</p>
						<div class="div-box clearfix">
							<label class="label-title" for=""><strong>*</strong>企业所在地
								: </label>
							<div class="div-box-right">
								<p>
									
									<select  class="select" th:field="*{tProvince}" onchange="changProvince(this)">
						              <option th:each="province : ${pList}" th:value="${province.id}" th:text="${province.provinceName}">Wireframe</option>
						            </select>
									
									<span>省</span> 
									<select id="tcity"  class="select" th:field="*{tCity}" >
						               <option value="option">请选择</option>
						            </select>市
								</p>
								<p>
									<label for="">详细地址</label> <input class="input" type="text" th:field="*{address}"
										placeholder="请输入详细地址" id="address" name="address"/>
								</p>
							</div>
						</div>
						<p>
							<label for=""><strong>*</strong>固定电话 : </label> <input
								class="input" type="text" placeholder="请输入固定电话"   th:field="*{registeredPhone}" id="registeredphone" name="registeredphone"/>
						</p>
						<div class="div-box clearfix">
							<label class="label-title" for=""><strong>*</strong>公司主营业务
								: </label>
							<div class="div-box-right">
								<p>
									<label th:each="industry,iterationStatus: ${industryList}"><input type="checkbox" th:field="*{mainBusiness}" th:text="${industry.industryName}" th:value="${industry.id}"/></label>							   
									   
								</p>
								<p>
<!-- 									<label for=""><input type="checkbox" name="ckother" id="ckother"/> 其他</label> <label style="display:none;" id="otherlabel"><input -->
<!-- 										type="text" id="industryother" name="industryother"/> -->
<!-- 									<button type="button" value="">添加行业</button></label> -->
								</p>
								<p>
									<label for=""><input type="checkbox"/> 添加的词</label>
								</p>
							</div>
						</div>
						<p>
							<label for=""><strong>*</strong>企业类型 : </label> 
							
							<select  class="select" id="" name="orgType">
				              <option th:each="orgType : ${orgList}" th:value="${orgType.id}" th:text="${orgType.typeName}">Wireframe</option>
				            </select>
						</p>
						<p>
							<label for="">注册资金 : </label> <input class="input" type="text"
								placeholder="注册资金" id="industryother" name="industryother" th:field="*{registeredCapital}"/>
						</p>
						<p>
							<label for=""><strong>*</strong>组织机构代码 : </label> <input
								class="input" type="text" placeholder="组织机构代码"  th:field="*{organizationCode}" id="organizationcode" name="organizationcode"/>
						</p>
						<p>
							<label for=""><strong>*</strong>税务登记号 : </label> <input
								class="input" type="text" placeholder="税务登记号"  th:field="*{taxNo}" id="taxno" name="taxno" />
						</p>
						<div class="div-box clearfix">
							<label class="label-title" for=""><strong>*</strong>是否一般纳税人
								: </label>
							<div class="div-box-right">
								<p>
									<label for=""><input type="checkbox"  th:field="*{isGeneralTaspayer}" value="1" /> 是</label> <label
										for=""><input type="checkbox"  th:field="*{isGeneralTaspayer}" value="2"/> 否</label>
								</p>
							</div>
						</div>
						<p>
							<label for=""><strong>*</strong>企业营业执照 : </label> <input
								type="file" value=""/> <span class="span-prompt">温馨提示：上传的图片需清晰易识别，并且文件不能小于2M</span>
						</p>
						<p>
							<label for=""><strong>*</strong>机构组织代码证 : </label> <input
								type="file" value=""/> <span class="span-prompt">温馨提示：上传的图片需清晰易识别，并且文件不能小于2M</span>
						</p>
						<p>
							<label for=""><strong>*</strong>税务登记证 : </label> <input
								type="file" value=""/> <span class="span-prompt">温馨提示：上传的图片需清晰易识别，并且文件不能小于2M</span>
						</p>
						<p>
							<label for=""><strong>*</strong>开户行名称 : </label> 
							<select  class="select w150" id="" th:field="*{bankName}">
				              <option th:each="bank : ${bankList}" th:value="${bank.id}" th:text="${bank.name}">Wireframe</option>
				            </select> <input class="input w150" type="text" placeholder="开户支行名称" id="bankname" th:text="${branch}" name="bankname"/>
						</p>
						<p>
							<label for=""><strong>*</strong>开户行账号 : </label> <input
								class="input" type="text" placeholder="开户行账号" id="bankno" name="bankno" th:text="${bankAccount}"/>
						</p>
						<p>
<!-- 							<label for="">所属语言 : </label> <select class="select" name="" -->
<!-- 								id=""> -->
<!-- 								<option value="">中文(简体)</option> -->
<!-- 								<option value="">English</option> -->
<!-- 							</select> -->
						</p>
						<p>
							<label for=""></label> <span> <input type="checkbox"
								checked="checked"/> <em>已阅读并同意</em> <a href="#">《企业账户注册协议》</a>
							</span>
						</p>
						<p class="btn-bar">
							<label for=""></label> <span>
								<button class="btn btn-cyan" type="submit">提交</button>
								<button class="btn" type="reset" >取消</button>
							</span>
						</p>
					</form>
				</div>
			</div>
		</section>
	</article>
</body>
<script>
	//<![CDATA[
          function changProvince(obj){
        	    var provinceId = obj.options[obj.selectedIndex].value;
        	   /*  alert("The option you select is:"+opt.text+"("+opt.value+")"); */
					debugger;
           	    $.ajax({
       		        type:"GET",
       		        contentType: 'application/json', 
       		        url:"/api/" + provinceId + "/city",        
       		        success: function(response){	
       		        	debugger;
       		        	var html = '';
       		        	$.each(response, function(i, item) {
       		        		html = html + '<option value="' + item.id + '">' + item.cityName + '</option>';
       		    	 	})
       		    	 	$("#tcity").html(html);
       		        }
       	    	});
          }
		//]]>
</script>           
<script data-main="../js/page/a1_register" src="../lib/requirejs/require.js"></script>
</html>